import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../views/layout'
import ShangZheng from '../views/gupiao/shangzheng'
import ShenZhen from '../views/gupiao/shenzhen'
import HuShen from '../views/gupiao/hushen'
import ChuangYe from '../views/gupiao/chuangye'
import ChuanMei from '../views/gupiao/chuanmei'
import BaiJiu from '../views/gupiao/baijiu'
import JunGong from '../views/gupiao/jungong'
import BaoXian from '../views/gupiao/baoxian'
import MeiTan from '../views/gupiao/meitan'
import NongYe from '../views/gupiao/nongye'
import TMT from '../views/gupiao/tmt'
import Jijian from '../views/gupiao/jijian'
import XiaoFei from '../views/gupiao/xiaofei'
import XinNengYuan from '../views/gupiao/xinnengyuan'
import YinHang from '../views/gupiao/yinhang'
import YiYao from '../views/gupiao/yiyao'
import ZhengQuan from '../views/gupiao/zhengquan'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    // 命名路由 layout 有一个默认子路由，这个名字没有意义，所以警告
    // 正确的做法是：如果有默认子路由，就不要给父路由起名字了
    // name: 'layout',
    component: Layout,
    children: [
      {
        // 我们通常会把根路径 / 设置为网站的首页
        // 为啥呢？因为我们在手动输入网址访问网站的时候，可以省略 /
        // 如果你是别的名称，则必须加上
        path: '', // path 为空，会作为默认子路由渲染

        // 路由的名字是干啥的？
        // 参考：https://gitee.com/lipengzhou/toutiao-publish-admin/issues/I1F1BA
        name: 'shangzheng',
        component: ShangZheng
      },
      {
        path: '/shenzhen',
        name: 'shenzhen',
        component: ShenZhen
      },
      {
        path: '/hushen',
        name: 'hushen',
        component: HuShen
      },
      {
        path: '/chuangye',
        name: 'chuangye',
        component: ChuangYe
      },
      {
        path: '/jijian',
        name: 'jijian',
        component: Jijian
      },
      {
        path: '/chuanmei',
        name: 'chuanmei',
        component: ChuanMei
      },
      {
        path: '/jungong',
        name: 'jungong',
        component: JunGong
      },
      {
        path: '/baijiu',
        name: 'baijiu',
        component: BaiJiu
      },
      {
        path: '/baoxian',
        name: 'baoxian',
        component: BaoXian
      },
      {
        path: '/meitan',
        name: 'meitan',
        component: MeiTan
      },
      {
        path: '/nongye',
        name: 'nongye',
        component: NongYe
      },
      {
        path: '/tmt',
        name: 'tmt',
        component: TMT
      },
      {
        path: '/xiaofei',
        name: 'xiaofei',
        component: XiaoFei
      },
      {
        path: '/xinnengyuan',
        name: 'xinnengyuan',
        component: XinNengYuan
      },
      {
        path: '/yinhang',
        name: 'yinhang',
        component: YinHang
      },
      {
        path: '/yiyao',
        name: 'yiyao',
        component: YiYao
      },
      {
        path: '/zhengquan',
        name: 'zhengquan',
        component: ZhengQuan
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
